﻿<UserControl x:Class="Giraffe.Client.MainWindowModule.Contacts.ContactControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Common="clr-namespace:Giraffe.Client.Common;assembly=Giraffe.Client.Common"
    >
    <UserControl.Resources>
        <Style x:Key="contactTextBlockStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsOnline}" Value="True">
                    <Setter Property="Foreground" Value="Green"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <ContentControl>
        <TextBlock Text="{Binding Path=Name}" Style="{StaticResource contactTextBlockStyle}"/>
        <Common:Events.Commands>
            <Common:EventCommandCollection>
                <Common:EventCommand CommandName="WriteToCommand" EventName="MouseDoubleClick"/>
            </Common:EventCommandCollection>
        </Common:Events.Commands>
    </ContentControl>
</UserControl>
